<?php
$chatLogFile = 'chat.log';

$action = $_GET['action'] ?? $_POST['action'] ?? '';

if ($action == 'clearAllChat') {
    $file = fopen($chatLogFile, "w");
} else if ($action == 'clearHot') {
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $counterKey = 'peopleCount';
    $currentCount = $redis->set($counterKey, 0);
    $_SESSION = array();
}